package com.teamin.service;

import com.teamin.entity.CircleEntity;
import com.teamin.entity.MessageEntity;
import com.teamin.entity.TaskEntity;
import com.teamin.web.exception.GlobalErrorInfoException;

import java.util.List;

public interface MessageService {

    public static String TASK_TYPE_ASSIGNER="assigner" ;//任务的执行者
    public static String TASK_TYPE_STATE_ID="state_id" ;//任务状态
    MessageEntity selectByPrimaryKey(Long messageId) throws GlobalErrorInfoException;

    List<MessageEntity> getMessageByUserAndCircle(Long userId, Long circleId) throws GlobalErrorInfoException;

    /**
     * 更新任务的消息,同步通知
     * @param oldTask
     * @param newTask
     * @param controlUserId
     */
    void updateTaskMessage(TaskEntity oldTask, TaskEntity newTask, Long controlUserId,String userFlag);

    void deleteTaskMessage(TaskEntity taskEntitye, CircleEntity circleEntities, Long controlUserId,String userFlag);

    void taskRemind(Long taskId,String userFlag);

    /**
     * 创建新任务消息
     * @param taskEntity
     * @param circleId
     */
    Long createNewTaskMessage(TaskEntity taskEntity, Long circleId, Long controlUserId,String userFlag);

    void SendUserTaskState();

    /**
     * 获取用户的消息
     * @param userId 用户ID
     * @return
     */
    List<MessageEntity> getMessageByUser(Long userId,Integer readState);

    /**
     * 设置消息为已读状态
     * @param userId 消息ID
     * @param messageIds 消息ID字符串
     * @return
     */
    int setMessageReaded(Long userId, String messageIds,String userFlag);
}
